<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head>
	<title>Login</title>
</h:head>
<h:body>

	<h:outputLink id="link" onclick="telaLogin.show()">
	link
	</h:outputLink>

	<h:form id="formtelalogin" >
		 <p:growl id="mensagemAutenticacao" showDetail="true" life="3000"/> 
		<p:dialog id="logintela" header="Login" widgetVar="telaLogin"
			modal="true" resizable="true" visible="true">

			<h:panelGrid id="panel" columns="1" cellspacing="3">
				<h:outputLabel value="Login:*" />
				<h:panelGrid columns="2">
					<p:inputText id="usuario" required="true" size="10"
						label="Necessario preencher o campo"
						value="#{loginAction.username}" />
					<p:message for="usuario" display="icon" />
				</h:panelGrid>

				<h:outputLabel value="Senha:*" />
				<h:panelGrid columns="2">
					<p:password id="senhalogin" required="true" feedback="false"
						size="10" value="#{loginAction.password}" />
					<p:message for="senhalogin" display="icon" />
				</h:panelGrid>

			</h:panelGrid>

			<p:commandButton value="login" update="mensagemAutenticacao"
				 />
				

		</p:dialog>

	</h:form><!--
	<script type="text/javascript">
	function loginRequest(xhr, status, args){
		if(args.validationFailed || !args.loggedIn){
			jQuery('#dialog').parent().effect("shake", {times:3}, 100);
			
			}else{
				telaLogin.hide();
				jQuery('#link').fadeout();

				}

		}

</script>


--></h:body>

</html>